/*
 ------------------------------------------------------------------------------
 Copyright (C) 2009-2011 Eternal Games.

 This file is part of the Eternal Tech source code.

 The Eternal Tech source code is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or (at your
 option) any later version.

 The Eternal Tech source code is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 more details.

 You should have received a copy of the GNU General Public License along with
 the Eternal Tech source code; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ------------------------------------------------------------------------------
*/


//
// s_alState.cpp - AL state manager
//


#include "s_local.h"


/*
 ==================
 S_CheckForErrors
 ==================
*/
void S_CheckForErrors ()
{
	const char   *string;
	int			 error;

	if ((error = qalGetError()) == AL_NO_ERROR)
		return;

	switch (error){
	case AL_INVALID_NAME:
		string = "AL_INVALID_NAME";
		break;
	case AL_INVALID_ENUM:
		string = "AL_INVALID_ENUM";
		break;
	case AL_INVALID_VALUE:
		string = "AL_INVALID_VALUE";
		break;
	case AL_INVALID_OPERATION:
		string = "AL_INVALID_OPERATION";
		break;
	case AL_OUT_OF_MEMORY:
		string = "AL_OUT_OF_MEMORY";
		break;
	default:
		string = "UNKNOWN ERROR";
		break;
	}

	Com_Error(ERR_FATAL, "S_CheckForErrors: %s", string);
}